<?php

declare(strict_types=1);

namespace app\command;

use app\command\model\DbMvcModel;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;

class DbMvc extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('dbmvc')
            ->addOption('table','t',Option::VALUE_REQUIRED)
            ->setDescription('the dbmvc command');
    }

    protected function execute(Input $input, Output $output)
    {
        // 指令输出
        // $output->writeln('dbmvc');
        // php think autotask --test # 人工测试（不受时间计划的限制，立即执行）
        $table=$input->getOption('table');
        $output->writeln($table);
        $model=new DbMvcModel();
        $dbList=$model->getDatabases();
        var_export($dbList);
    }
}
